fs/xfs: Ensuring failing to mount sets a grub_errno
authorB Horn <b@horn.uk>
Sun, 12 May 2024 05:03:58 +0000 (06:03 +0100)
committerFelix Zielcke <fzielcke@z-51.de>
Thu, 3 Jul 2025 16:35:51 +0000 (18:35 +0200)
commit4f44f9a948c59ebb470de5a5c3f164c7831d4a90
treee935a39bd5ded701f7d32a088753370589469bca
parentc87d2e3edbc8dc725aa2c75fe6fcb8a51fc5c846
fs/xfs: Ensuring failing to mount sets a grub_errno

It was previously possible for grub_xfs_mount() to return NULL without
setting grub_errno if the XFS version was invalid. This resulted in it
being possible for grub_dl_unref() to be called twice allowing the XFS
module to be unloaded while there were still references to it.

Fixing this problem in general by ensuring a grub_errno is set if the
fail label is reached.

Reported-by: B Horn <b@horn.uk>
Signed-off-by: B Horn <b@horn.uk>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Gbp-Pq: Topic cve-2025-jan
Gbp-Pq: Name fs-xfs-Ensuring-failing-to-mount-sets-a-grub_errno.patch
grub-core/fs/xfs.c